marko
Version:
UI Components + streaming, async, high performance, HTML templating for Node.js and the browser.
21 lines (17 loc) • 451 B
JavaScript
import { types as t } from "@marko/compiler";
import { decode } from "he";
import write from "../util/vdom-out-write";
import withPreviousLocation from "../util/with-previous-location";
export default function (path) {
const { node } = path;
path.replaceWith(
withPreviousLocation(
write(
"t",
t.stringLiteral(decode(node.value)),
path.hub.file._componentInstanceIdentifier,
),
node,
),
);
}